package com.gitee.kamismile.akka.start;


import akka.actor.ActorSystem;
import com.gitee.kamismile.akka.di.SpringExtension;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan(basePackages = "com.gitee.kamismile.akka")
public class StoneAkkaAutoConfig {

    @Bean("actorSystem")
    public ActorSystem actorSystem() {
        Config config = ConfigFactory.load();
        ActorSystem actorSystem = ActorSystem.create("ClusterSystem", config);
        return actorSystem;
    }

    @Bean("springExtension")
    public SpringExtension springExtension() {
        return new SpringExtension();
    }
}
